package PTA_7_52;

import java.util.Scanner;

public class Main {
    public static String reverse(String str) {
        return new StringBuffer(str).reverse().toString();
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        char ch[] = str.toCharArray();

        for (int i = 0; i < ch.length; i++) {
            if(ch[i]>='a'&&ch[i]<='z')
                ch[i] -= 32;
            else if(ch[i]>='A'&&ch[i]<='Z')
                ch[i] += 32;
        }

        str = new String(ch);
        System.out.println(reverse(str));
    }
}
